import VueRouter from 'vue-router'

// 导入自定义的路由
// tabbar↓
import HomeContainer from "./components/tabbar/HomeContainer.vue"
import MemberContainer from "./components/tabbar/MemberContainer.vue"
import ShoppingcarContainer from "./components/tabbar/ShoppingcarContainer.vue"
import SearchContainer from "./components/tabbar/SearchContainer.vue"
// news↓
import newlist from "./components/news/newlist.vue";
import newsinfo from "./components/news/newsinfo.vue";

// 创建路由对象
var router = new VueRouter({
    routes: [ // 路由配置
        {path: '/', redirect: '/home'},
        // tabbar
        {path: '/home', component: HomeContainer},
        {path: '/member', component: MemberContainer},
        {path: '/shopcar', component: ShoppingcarContainer},
        {path: '/search', component: SearchContainer},

        // home
        {path: '/home/newlist', component: newlist},
        {path: '/home/newsinfo/:id', component: newsinfo}
    ],
    linkActiveClass: 'mui-active' //覆盖默认的路由active高亮类
})

// 把路由对象暴露出去
export default router